Skip to content

Cognito package parity#57

Draft
zdburrage wants to merge 1 commit intomainfrom
feat/cognito-package-parity
Draft

Cognito package parity#57
zdburrage wants to merge 1 commit intomainfrom
feat/cognito-package-parity

Conversation

@zdburrage
Copy link
Copy Markdown
Collaborator

@zdburrage zdburrage commented May 6, 2026

Summary

Phase 11 of the provider-parity execution plan. Cognito now writes a provider-neutral migration package alongside the existing loose-CSV output.

  • New src/providers/cognito/package-exporter.ts orchestrates the package output. Handles user-pool, connection, and none org strategies (default: user-pool — one WorkOS org per Cognito user pool). Federated/JIT users are skipped by default in package mode.
  • SSO handoff reuses the shared SSO handoff utilities to emit canonical sso/saml_connections.csv, sso/oidc_connections.csv, sso/custom_attribute_mappings.csv, and sso/proxy_routes.csv. Raw provider snapshots land under raw/cognito-providers.jsonl.
  • workos_upload/ projection is written from the same source IDs as the package files. Connection org strategy emits header-only memberships with a structured warning.
  • CognitoClient.exportPackage() is the new entry point; exportEntities() is unchanged. export-cognito CLI gains --package and --org-strategy; the legacy loose-CSV mode still produces workos_saml_connections.csv, workos_oidc_connections.csv, custom_attribute_mappings.csv, and workos_users.csv.
  • Tests cover federated user skipping, manifest generation, SAML/OIDC handoff, custom attribute mapping, and the connection org strategy warning path.
  • README documents the package flow and points at import-package.

Test Plan

  • npm run lint
  • npm run format:check
  • npm run typecheck
  • npm run build
  • npm test — 272 passing across 24 suites.

🤖 Generated with Claude Code

Phase 11 of the provider-parity plan. Cognito now writes a
provider-neutral migration package alongside the existing loose-CSV
output.

- New \`src/providers/cognito/package-exporter.ts\` orchestrates the
  package output. Handles user-pool, connection, and none org
  strategies; defaults to user-pool (one WorkOS org per Cognito user
  pool). Federated/JIT users (userStatus=EXTERNAL_PROVIDER) are skipped
  by default in package mode.
- SSO handoff reuses \`src/sso/handoff.js\` to emit canonical
  \`sso/saml_connections.csv\`, \`sso/oidc_connections.csv\`,
  \`sso/custom_attribute_mappings.csv\`, and \`sso/proxy_routes.csv\`.
  Raw provider snapshots land under \`raw/cognito-providers.jsonl\`.
- \`workos_upload/\` projection is written from the same source IDs as
  the package files. When the connection org strategy is used,
  memberships drop to a header-only file with a structured warning so
  importers know not to expect membership rows.
- CognitoClient gains \`exportPackage()\` while keeping the existing
  \`exportEntities()\` flow untouched. \`export-cognito\` CLI grows
  \`--package\` and \`--org-strategy\` flags; loose mode (the previous
  default) still produces \`workos_saml_connections.csv\`,
  \`workos_oidc_connections.csv\`, \`custom_attribute_mappings.csv\`,
  and \`workos_users.csv\`.
- Tests cover federated user skipping, manifest generation, SAML/OIDC
  handoff, custom attribute mapping, and the connection org strategy
  warning path.
- README documents the package flow and points at \`import-package\`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant